feat: Add signature and quotes in RichHtmlEditorWebview#2811
feat: Add signature and quotes in RichHtmlEditorWebview#2811
Conversation
951b1be to
532e2be
Compare
app/src/main/java/com/infomaniak/mail/ui/newMessage/BodyContentPayload.kt
Outdated
Show resolved
Hide resolved
LunarX
left a comment
There was a problem hiding this comment.
Check if the computation of saveSnapshot and isSnapshotTheSame are correct when you open a new message, modify nothing and then leave. Because right now it saves a new draft everytime even when there are no modifications
app/src/main/java/com/infomaniak/mail/ui/newMessage/NewMessageFragment.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/infomaniak/mail/ui/newMessage/NewMessageFragment.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/infomaniak/mail/ui/newMessage/NewMessageFragment.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/infomaniak/mail/ui/newMessage/NewMessageFragment.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/infomaniak/mail/ui/newMessage/NewMessageFragment.kt
Show resolved
Hide resolved
app/src/main/java/com/infomaniak/mail/ui/newMessage/NewMessageFragment.kt
Outdated
Show resolved
Hide resolved
|
|
This PR/issue depends on: |
| .onEach { isVisible -> binding.newMessagePlaceholder.isVisible = isVisible } | ||
| .launchIn(lifecycleScope) | ||
| private fun removePlaceholder() { | ||
| binding.newMessagePlaceholder.visibility = View.GONE |
There was a problem hiding this comment.
We usually prefer writing it like this:
| binding.newMessagePlaceholder.visibility = View.GONE | |
| binding.newMessagePlaceholder.isGone = true |
| if (initResult.value == null) { | ||
| initDraftAndViewModel(intent = requireActivity().intent).observe(viewLifecycleOwner) { draft -> | ||
| if (draft != null) { | ||
| val isBodyEmpty = newMessageViewModel.bodyHasPlaceholder(draft.body) |
There was a problem hiding this comment.
Won't this always return true because of the user's signature?
Would it work to remove the signature and quote divs and do this computation on what's left instead?
| webViewClient = initWebViewClientAndBridge( | ||
| attachments = draft.attachments, | ||
| messageUid = "MESSAGE-" + draft.messageUid, | ||
| shouldLoadDistantResources = true, | ||
| navigateToNewMessageActivity = null | ||
| ) |
There was a problem hiding this comment.
If you are going to use a custom WebViewClient, follow the setup from the readme on how to use a custom one





Depends on Infomaniak/android-rich-html-editor#46